//
//  CLDoctorAttentionTableViewCell.m
//  CareLink
//
//  Created by apple on 16/8/21.
//  Copyright © 2016年 Seven Team. All rights reserved.
//

#import "CLDoctorAttentionTableViewCell.h"
#import "CLDoctorAttentionModel.h"

@interface CLDoctorAttentionTableViewCell ()


/**
 *  点击聊天跳转
 */
@property (weak, nonatomic) IBOutlet UIButton *chatBtn;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *bannerLabel;
@property (weak, nonatomic) IBOutlet UILabel *flowerLabel;
@property (weak, nonatomic) IBOutlet UILabel *hospitalLabel;
@property (weak, nonatomic) IBOutlet UILabel *starLabel;
@end




@implementation CLDoctorAttentionTableViewCell
// 设置子空间
- (void)setModel:(CLDoctorAttentionModel *)model
{
    _model = model;
//    doctorCount
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.doctor_portrait] placeholderImage:[UIImage imageNamed:@"doctorCount"]];
    // 设置圆角的大小
    self.iconImageView.layer.cornerRadius = self.iconImageView.width / 2;
    [self.iconImageView.layer setMasksToBounds:YES];
    self.nameLabel.text = model.doctor_name;
    self.nameTitleLabel.text = model.doctor_title_name;
    self.bannerLabel.text = [NSString stringWithFormat:@"%zd",model.operation_count];
    self.flowerLabel.text = [NSString stringWithFormat:@"%zd",model.flower];
    self.hospitalLabel.text = model.doctor_hospital_name;
    self.starLabel.text = [NSString stringWithFormat:@"%zd",model.banner];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    [self.chatBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];

}

// button点击
- (void)btnClick:(UIButton*)btn
{
    self.block(self,btn);
    
}
@end
